﻿using System;
using System.Collections.Generic;
using Gameplay.PVE.Utils;
using UnityEngine;
using XLua;
using Yoozoo.Framework.Core;

namespace Gameplay.PVE.Survivor
{
    public class RpgMissionConfig
    {
        public int id;
        public List<Vector2Int> hero_default_deploy;
        public int is_deploy;

        public string name;
        public float attribute_ratio;
        public float attribute_ratio_atk;
        public float attribute_ratio_def;
        public float attribute_ratio_hp;
        public float ratio_money;
        public List<Vector3> drop_item;
        public int drop_money_limit;
        public int show_ui_task;
        public int show_ui_battlestart;
        public string task_content;
        public string task_img;
        public int client_report_start;
        public int client_report_end;
    }
    
    public partial class BattleConfigManager
    {
        private Dictionary<int, RpgMissionConfig> missionMap;
        
        public RpgMissionConfig GetRpgMissionConfig(int id)
        {
            if (missionMap.TryGetValue(id,out var config))
            {
                return config;
            }
            UnityEngine.Debug.LogError("任务找不到" + id);
            return null;
        }
        
        public static void PreloadRpgMissionConfig(LuaTable table)
        {
            PveUtils.PreloadRpgConfig(table,ref Instance.missionMap);
        }
    }
}
